import "@/assets/style/antd.less";
import {
  Button,
  message,
  Spin,
  Table,
  Tag,
  ConfigProvider,
  Row,
  Col,
  Space,
  Icon,
  Dropdown,
  Menu,
  Form,
  FormModel,
  Input,
  Select,
  Popconfirm,
  Modal,
  Avatar,
  Breadcrumb,
  Badge,
  Cascader,
  InputNumber,
  Radio,
  Tooltip,
  DatePicker,
  Popover,
  Card,
  Result,
  PageHeader,
  Divider,
  Tabs,
  Empty,
  notification,
  Descriptions,
  Upload,
  Progress
} from "ant-design-vue";

// 全部组件
// https://github.com/vueComponent/ant-design-vue/blob/master/components/index.js
const useComponent = [
  Button,
  Spin,
  Table,
  Tag,
  ConfigProvider,
  Row,
  Col,
  Space,
  Icon,
  Dropdown,
  Menu,
  Form,
  FormModel,
  Input,
  Select,
  Popconfirm,
  Modal,
  Avatar,
  Breadcrumb,
  Badge,
  Cascader,
  InputNumber,
  Radio,
  Tooltip,
  DatePicker,
  Popover,
  Card,
  Result,
  PageHeader,
  Divider,
  Tabs,
  Empty,
  Descriptions,
  Upload,
  Progress
];

export default {
  install(Vue) {
    useComponent.map((el) => {
      Vue.use(el);
    });

    Vue.prototype.$message = message;
    Vue.prototype.$confirm = Modal.confirm;
    Vue.prototype.$notification = notification;
  }
};
